{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "float64\n",
      "(20, 1)\n",
      "[[ 0.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]\n",
      " [ 1.]]\n"
     ]
    }
   ],
   "source": [
    "import h5py\n",
    "import numpy\n",
    "\n",
    "FILENAME = 'seq2.h5'\n",
    "\n",
    "# Edit the shape here:\n",
    "T = 20\n",
    "N = 1 #16\n",
    "\n",
    "# My sequence indicators\n",
    "indicators = numpy.ones((T,N))\n",
    "print indicators.dtype\n",
    "print indicators.shape\n",
    "\n",
    "for i in range(0,N):\n",
    "  indicators[0][i] = 0\n",
    "print indicators[0:20]\n",
    "# print indicators[20:30]\n",
    "\n",
    "# Open an HDF5 file\n",
    "h5file = h5py.File( FILENAME, 'w')\n",
    "\n",
    "# Set Sequence indicator\n",
    "dataset = h5file.create_dataset('sequence', shape=indicators.shape, dtype=indicators.dtype)\n",
    "dataset[:] = indicators\n",
    "\n",
    "h5file.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
